{% extends "base.html" %}

{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/auth.css') }}">
{% endblock %}

{% block content %}
<div class="auth-container">
    <div class="auth-box">
        <h2>用户登录</h2>
        <form method="POST" action="{{ url_for('login') }}" class="auth-form" onsubmit="return validateLoginForm(event)">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" id="username" name="username" required 
                       placeholder="请输入用户名">
                <span class="error-message" id="username-error"></span>
            </div>

            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" id="password" name="password" required 
                       placeholder="请输入密码">
                <span class="error-message" id="password-error"></span>
            </div>

            <button type="submit" class="auth-button">登录</button>
        </form>
        <div class="auth-links">
            <p>还没有账号？<a href="{{ url_for('register') }}">立即注册</a></p>
        </div>
    </div>
</div>
{% endblock %}

{% block extra_js %}
<script src="{{ url_for('static', filename='js/auth.js') }}"></script>
{% endblock %}
